//
//  GGCalendarView.h
//  ggtool
//
//  Created by engfei on 2017/4/26.
//  Copyright © 2017年 GaiGai. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface GGCalendarTitleView : UIView

@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *detailLabel;
// title与detail的高度比例(默认为2)
@property (nonatomic, assign) CGFloat ratioH;
// 默认detailLabel是不显示的
@property (nonatomic, assign) BOOL isHiddenDetail;
// 选中
@property (nonatomic, strong) UIColor *selectedColor;
@property (nonatomic, assign) BOOL selected;

@property (nonatomic, assign) NSUInteger row;
@property (nonatomic, assign) NSUInteger column;

@end

@class GGCalendarLogicView;
@protocol GGCalendarLogicViewDataSource <NSObject>
@required
- (NSUInteger)numberOfRowsCalendarView:(GGCalendarLogicView *)view;
- (GGCalendarTitleView *)titleView:(GGCalendarLogicView *)view forRow:(NSUInteger)row column:(NSUInteger)column;
@optional
- (CGFloat)heightForRowtitleView:(GGCalendarLogicView *)view;

@end

@protocol GGCalendarLogicViewDelegate <NSObject>

- (void)calendarView:(GGCalendarLogicView *)view didSelectedAtRow:(NSUInteger)row column:(NSUInteger)column;

@end

@interface GGCalendarLogicView : UIView

@property (nonatomic, weak) id<GGCalendarLogicViewDataSource> dataSource;
@property (nonatomic, weak) id<GGCalendarLogicViewDelegate> delegate;
// 缓冲池,数据源返回必须使用该方法
- (GGCalendarTitleView *)dequeueReusableTitleViewAtRow:(NSUInteger)row column:(NSUInteger)column;

// 添加数据
- (void)reloadData;

- (NSUInteger)numberOfRows;

- (GGCalendarTitleView *)titleForRow:(NSUInteger)row column:(NSUInteger)column;

- (CGFloat)viewHeight;

@end
